<template>

<div class="recharge">

        <div class="header"><van-nav-bar title="转账" left-text="返回"  @click-left="$router.go(-1)"  left-arrow/></div>

        <div class="transfer">
            <div title><img :src="require('../../assets/img/home_5.png')" /><span>USDT</span></div>
            <div put>
                <div>
                    <div>对方账号</div>
                     <van-cell-group><van-field v-model="touserurl" placeholder="请输入钱包地址" /></van-cell-group>
                </div>
                <div>
                    <div>转账金额</div>
                    <van-cell-group><van-field v-model="azcnumber" placeholder="请输入转账金额" /></van-cell-group>
                    <div point>
                        <div>手续费:<span>5</span>%</div>
                        
                    </div>
                </div>
            </div>
        </div>
     
        <div sub> <van-button type="default" @click="sub">确认</van-button></div>

       
     </div>


</template>

<script>

export default {

data() {
    return {
             touserurl:'',
             azcnumber:'',
    }
},
mounted() { 
   var that=this;
    that.base.head_status()
},

 methods: {
    sub(){
        let that=this;
        if(that.azcnumber<100){
          return  that.$toast({ message: "转账金额必须大于100" });
        }
     that.$router.push({name:'verif_pwd',params:{type:'usdtransfer','touserurl':that.touserurl,'usdtnumber':that.azcnumber}})
        return
              that.$dialog.confirm({ title: '提示信息',message: '确定要转账到此用户吗'}).then(() => {  
                     
                   that.$toast.loading({ message: '加载中...', forbidClick: true,overlay:true});
               var data={token:JSON.parse(localStorage.userinfo).token,'touserurl':that.touserurl,'usdtnumber':that.azcnumber}
                    that.$toast.clear();
                       that._API.usdtransfer(data,that).then(res => {

                             that.$dialog.alert({title: '提示信息', message: res.msg }).then(() => {
                               if(res.code==200){
                                that.azcnumber='';
                                }
                          });
                           
                           
                        }).catch(err => {
                            console.log("err", err);
                        });
                }).catch(() => {
            // on cancel
            });
    },
      
       
     


}
}
</script>


<style lang="scss" scoped >


   
    /deep/.van-nav-bar,/deep/.transfer .van-cell-group,/deep/.transfer .van-cell{background-color: initial;}
    .header *,/deep/.van-nav-bar .van-icon,/deep/.transfer *,/deep/.transfer .van-field__control::-webkit-input-placeholder{color:white}


    .recharge [sub]{text-align: center;}
    .recharge [sub] .van-button{background-color: #831BFA;color: white;border:0;border-radius: 3rem;width: 90%;}

    .transfer{margin: 1rem;padding: 1rem;    border-radius: .3rem; box-shadow: inset 0 0 1rem 0px #7b00ff;}   
    .transfer [title]{display: flex;align-items: center;justify-content: center;}
    .transfer [title] span{padding-left: .5rem;}

    .transfer [put]>div{margin-top: 1rem;}
    .transfer [put] [point]{display: flex;font-size: 0.7rem;padding-top: .5rem}
    .transfer [put] [point]>div:nth-child(1){flex:1;}
    .transfer [point]>div,/deep/.transfer [point]>div>span{color:#929292}
    /deep/.transfer .van-cell{    padding: 10px 0px;    border-bottom: 1px solid #3e3e3e;}








       
</style>
